Features contribute lifecycle hooks#390
Merged
joshspicer merged 47 commits intomainfrom Mar 2, 2023
Merged
Conversation
…spicer/features-lifecycles-hooks
….com/devcontainers/cli into joshspicer/features-lifecycles-hooks
…spicer/features-lifecycles-hooks
…g 'up' Logs like 'Running the postCreateCommand from devcontainer.json' are updated to include the origin of the command e.g: 'Running the postCreateCommand from Feature 'common-utils'. This patch adds in a mapping object that is passed along and used to map a command to an origin. This change is a bit less efficient, with the added benefit of not needing to modify the existing merging logic.
…o /opt/build-features This is to support resuming a container in Codespaces with Feature-contributed lifecycle hooks. Codespaces bind-mounts a different volume on top of /tmp, so the container's /tmp directory is not persisted.
Member
samruddhikhandale
left a comment
There was a problem hiding this comment.
Nice, left some comments!
233d4df to
6687ad4
Compare
Member
Author
|
Validating that publishing Features with lifecycle hook commands function as expected: Note that:
With the file structure: Stopping the container and using the CLIs |
Member
Author
chrmarti
requested changes
Feb 20, 2023
Contributor
chrmarti
left a comment
There was a problem hiding this comment.
LGTM, left one comment.
chrmarti
approved these changes
Mar 2, 2023
Contributor
chrmarti
left a comment
There was a problem hiding this comment.
We should agree on how we want to include the origin of the lifecycle hooks as part of devcontainers/spec#206. IMO we can still merge the work here since it only affects the mergedConfiguration which does not need to adhere to a schema in the specification yet. 👍
joshspicer
added a commit
to devcontainers/spec
that referenced
this pull request
Mar 3, 2023
With CLI v0.32.0 and devcontainers/cli#390, devcontainer-feature.json now support lifecycle hooks. Spec proposal: https://github.com/devcontainers/spec/blob/b1d19a5375f667a1bb91e86311bc37c36312996b/proposals/features-contribute-lifecycle-scripts.md
joshspicer
added a commit
to devcontainers/spec
that referenced
this pull request
Mar 10, 2023
* Add lifecycle hooks to devContainerFeature schema With CLI v0.32.0 and devcontainers/cli#390, devcontainer-feature.json now support lifecycle hooks. Spec proposal: https://github.com/devcontainers/spec/blob/b1d19a5375f667a1bb91e86311bc37c36312996b/proposals/features-contribute-lifecycle-scripts.md * Description for providing an option to lifecycle hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





This change implements:
https://github.com/devcontainers/spec/blob/b1d19a5375f667a1bb91e86311bc37c36312996b/proposals/features-contribute-lifecycle-scripts.md
The new contents of the imageMetadata (generated from the
lifecycle-hooks-advanced) test can be seen below: